<template>
	<view>
		<view class="doc_list">
			 <view class="doc_one" :key="item._id" v-for="item in docList">
				 <image :src="item.avatar"></image>
				 <view>
					 <view>
						 <text style="font-size: 25px; ">{{item.name}}</text>
						 <text style="font-size: 20px;">{{item.post}}</text>
					 </view>
					 <view>
						 简介：{{item.good_at}}
					 </view>
				 </view>
			 </view>
		</view>
	</view>
</template>

<script>
	import {getKeDoc} from '@/api/test.js'
	export default {
		data(){
			return {
				docList:[] //医生列表数据
			}
		},
		onLoad(options){
			console.log(options)//options.id 其他页面传来的科室id
			this.getDocList(options.id)
		},
		methods:{
			async getDocList(id){ //获取医生列表接口
				let res=await getKeDoc(id)
				console.log(res,"************")
				this.docList=res.data;
				if(res.data.length==0){
					uni.showToast({
						title:"本科暂无医生"
					})
					uni.navigateTo({
						url:"/pages/guaHao/index"
					})
				}
			}
		}
	}
</script>

<style lang="scss">
	.doc_list{
		width: 100vw;
		.doc_one{
			width: 100vw;
			height: 300px;
			display: flex;
			image{
				width: 150px;
				height: 150px;
				border-radius: 50%;
			}
		}
	}
</style>